

'layer render properties.
'stored in the render system _layersettings Tbag.
'with index = layer number.

Type TRenderLayerSettings

	Field index:Int

	'name for layer
	Field label:String

	'layer is visible if this is set to true.
	Field visible:Int

	'render alpha of this layer.
	Field alpha:Float
	
	'layer is scrolling when this is set to true.
	Field scrollable:Int
	
	
	
	Function Create:TRenderLayerSettings(index:Int)
		Local s:TRenderLayerSettings = New TRenderLayerSettings
		s.index = index
		s.label = "RenderLayer " + index
		Return s
	End Function
	
	
	
	Method New()
		alpha = 1.0
		visible = True
		scrollable = True
	End Method
	
	
	Method SetLabel(val:String)
		label = val
	End Method
	
	Method GetLabel:String()
		Return label
	End Method

		
	Method SetAlpha(val:Float)
		alpha = val
	End Method
	
	Method GetAlpha:Float()
		Return alpha
	End Method
	
	
	Method SetVisible(bool:Int)
		visible = bool
	End Method
	
	Method GetVisible:Int()
		Return visible
	End Method
	
	
	Method SetScrollable(bool:Int)
		scrollable = bool
	End Method
	
	
	Method GetScrollable:Int()
		Return scrollable
	End Method
	
	
	
	Method Read(s:TStream)
		Local newLine:String = ReadLine(s)
		While newLine <> "[/layersettings]"
			Local vals:String[] = newLine.Split("=")
			Select vals[0]
				Case "index"
					index = Int(vals[1])
				Case "label"
					label = vals[1]
				Case "alpha"
					alpha = Float(vals[1])
				Case "visible"
					visible = Int(vals[1])
				Case "scrollable"
					scrollable = Int(vals[1])
				Default
					RuntimeError "layersettings: " + newLine
			End Select
			newLine = ReadLine(s)
		Wend
	End Method


	Method Write(s:TStream)
		WriteLine(s, "[layersettings]")
		WriteLine(s, "index=" + index)
		WriteLine(s, "label=" + label)
		WriteLine(s, "alpha=" + alpha)
		WriteLine(s, "visible=" + visible)
		WriteLine(s, "scrollable=" + scrollable)
		WriteLine(s, "[/layersettings]")
	End Method
End Type